var core    = require("core")
,   db      = core.db
,   schema  = db.schema
,   send    = core.send;

var POST    = function(req, res, next){
    var body        = req.body
    ,   pid         = body.pid
    ,   platformId  = body.platformId;

    schema.Platform.remove({pid: pid}, function(err, msg){
        if(err)
            SEND = new send(200000);
        else{
            delete req.app.platform.item[platformId];
            req.app.platform.count = global.app.platform.count - 1;
            SEND = new send(0);
        };

        res.send(SEND);
    });

};

module.exports = POST;
